
<%--
  Created by IntelliJ IDEA.
  User: 钟
  Date: 2017/3/15
  Time: 10:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
    <link rel="stylesheet" type="text/css" href="${path}/css/public.css" />
    <link rel="stylesheet"
          href="${path}/css/themes/base/jquery.ui.all.css">
    <link rel="stylesheet" href="${path}/js/demos.css">

    <script type="text/javascript"
            src="${path}/js/jquery-1.7.2.js"></script>
    <script type="text/javascript"
            src="${path}/js/jquery.ui.core.js"></script>
    <script type="text/javascript"
            src="${path}/js/jquery.ui.widget.js"></script>
    <script type="text/javascript"
            src="${path}/js/jquery.ui.position.js"></script>
    <script type="text/javascript"
            src="${path}/js/jquery.ui.autocomplete.js"></script>
    <script type="text/javascript"
            src="${path}/js/jquery.ui.datepicker.js"></script>
    <script type="text/javascript"
            src="${path}/js/jquery.ui.datepicker-zh-CN.js"></script>
    <script src="${path}/js/jquery.ui.button.js"></script>
    <link rel="stylesheet" href="${path}/css/icons.css">
    <script src="${path}/js/icons.js"></script>


    <title>员工设置
    </title>

</head>
<body>
<!--头部-->
<div class="header">





    <div class="top">
        <div class="top_left">
            <span class="f1">欢迎您：ADMIN</span>
        </div>
        <div class="top_right">
            <a href="${path}/index.html" class="top_ico0">首页</a>
            <a href="${path}/initUpdatePassword.action" class="top_ico1">修改密码</a>
            <a href="${path}/user/initPersonalInfo.action" class="top_ico2">个人信息</a>
            <a href="${path}/logout.action" class="top_ico3">退出</a>
        </div>
    </div>
    <div class="top2">
        <p class="pro_id">客户关系管理系统 v2.0</p>
    </div>
</div>

<!--主体-->
<table class="main" border="0"

       style="width: 100%; background-color: #FFFFFF">
    <tr>
        <td width="140" style="vertical-align: top;">
            <div class="main_left">



                <script type="text/javascript" src="${path}/js/jquery.ui.accordion.js"></script>

                <script type="text/javascript">

                    $().ready(function() {
                        $('.menuTitle').click(function() {//添加menuTitle的click事件
                            if ($(this).next().is(":hidden")) {//隐藏判断
                                $('.menu_ul_div').slideUp();//隐藏 */
                                $(this).next().slideDown();//显示
                            } else {
                                if ($(this).next().attr("id") == 'menu_ul_div_1') {

                                    $('.menu_ul_div').slideUp();//隐藏 */
                                    $('#menu_ul_div_2').slideDown();//显示

                                }
                                ;
                                if ($(this).next().attr("id") == 'menu_ul_div_2') {

                                    $('.menu_ul_div').slideUp();//隐藏 */
                                    $('#menu_ul_div_3').slideDown();//显示

                                }
                                ;
                                if ($(this).next().attr("id") == 'menu_ul_div_3') {

                                    $('.menu_ul_div').slideUp();//隐藏 */
                                    $('#menu_ul_div_4').slideDown();//显示

                                }
                                if ($(this).next().attr("id") == 'menu_ul_div_4') {

                                    $('.menu_ul_div').slideUp();//隐藏 */
                                    $('#menu_ul_div_1').slideDown();//显示

                                }
                            }
                        });
                    });

                </script>
                <div class="sidebar">

                    <h2 id="menu1" class="menuTitle">客户管理</h2>
                    <div class="menu_ul_div" id="menu_ul_div_1"

                         style="display:none;">
                        <ul id="menu1_ul" class="menu_ul">
                            <li class="menuItem"><a href="${path}/customer/initConflict.action">客户冲突</a></li>
                            <li class="menuItem"><a href="${path}/customer/initAdd.action">添加客户</a></li>
                            <li class="menuItem"><a href="${path}/customer/initServe.action">服务中签约客户</a></li>
                            <li class="menuItem"><a href="${path}/customer/initNoServe.action">未签约客户</a></li>
                            <li class="menuItem"><a href="${path}/customer/initNoServeFirst.action">未签约-已初试</a></li>
                            <li class="menuItem"><a href="${path}/customer/initNoServeSecond.action">未签约-已复试</a></li>
                            <li class="menuItem"><a href="${path}/customer/getAllSea.action">公海客户</a></li>
                            <li class="menuItem"><a href="${path}/visitRecord/initSearch.action">拜访查询</a></li>
                        </ul>
                    </div>


                    <h2 id="menu2" class="menuTitle">合同管理</h2>
                    <div class="menu_ul_div" id="menu_ul_div_2"

                         style="display:none;">
                        <ul id="menu2_ul" class="menu_ul">
                            <li class="menuItem"><a href="${path}./contractTemplate/initList.action">合同模版</a></li>
                            <li class="menuItem"><a href="${path}/contract/initAdd.action">新增合同</a></li>
                            <li class="menuItem"><a href="${path}/contract/initContractValid.action">有效合同查询</a></li>
                            <li class="menuItem"><a href="${path}/contract/initContractInvalid.action">无效合同查询</a></li>
                            <li class="menuItem"><a href="${path}/contract/initPaymentReceivable.action">应收款查询</a></li>
                            <li class="menuItem"><a href="${path}/contract/initPaymentReceived.action">到款查询</a></li>
                        </ul>
                    </div>


                    <h2 id="menu3" class="menuTitle">报表管理</h2>
                    <div class="menu_ul_div" id="menu_ul_div_3"

                         style="display:none;">
                        <ul id="menu3_ul" class="menu_ul">
                            <li class="menuItem"><a href="${path}/report/initReport.action">拜访量报表</a></li>
                        </ul>
                    </div>


                    <h2 id="menu4" class="menuTitle">系统设置</h2>
                    <div class="menu_ul_div" id="menu_ul_div_4"
                         style="display:block;"
                    >
                        <ul id="menu4_ul" class="menu_ul">
                            <li class="menuItem"><a href="${path}/system/search.action">员工设置</a></li>
                            <li class="menuItem"><a href="${path}/announcement/search.action">公告管理</a></li>
                            <li class="menuItem"><a href="${path}/system/elses.action">其他设置</a></li>
                        </ul>
                    </div>

                </div>
            </div>
        </td>
        <td style="vertical-align: top;">
            <div class="main_right">


                <link rel="stylesheet" type="text/css" href="${path}/css/employee.css"/>
                <script type="text/javascript" src="${path}/js/jquery.jstree.js"></script>

                <script type="text/javascript">


                    //全局变量
                    var deptId = "";
                    $(function () {
                        $(".treeDiv")
                            .jstree({ "plugins" : ["themes","html_data","ui"] })
                            // 1) if using the UI plugin bind to select_node
                            .bind("select_node.jstree", function (event, data) {
                                //`data.rslt.obj` is the jquery extended node that was clicked
                                var id = data.rslt.obj.attr("id");

                                //alert("你点击的节点id:"+id);
                                $("#myForm_dept_id").val(id);
                                $("#myForm_user_realName").val("");
                                document.myForm.submit();
                            });
                        // 2) if not using the UI plugin - the Anchor tags work as expected
                        //    so if the anchor has a HREF attirbute - the page will be changed
                        //    you can actually prevent the default, etc (normal jquery usage)
                        //.delegate("a", "click", function (event, data) { event.preventDefault(); })



<<<<<<< HEAD
                        /* //如果有dept id, 则选中节点, 赋样式 jstree-clicked
                         var deptId = 	;
                         if(deptId == ""){
                         alert("没有拿到deptid");
                         }else{
                         alert("有拿到deptid:"+deptId);
                         } */
=======
						/* //如果有dept id, 则选中节点, 赋样式 jstree-clicked
						 var deptId = 	;
						 if(deptId == ""){
						 alert("没有拿到deptid");
						 }else{
						 alert("有拿到deptid:"+deptId);
						 } */
>>>>>>> da7ddd19e463a6946b04a661f45e5fd07ef7d39b

                        initDeptStyle();

                        //查看部门信息
                        $("#chooseRole").click(function(){
                            var config="resizable:no;center:yes;dialogWidth:500px;dialogHeight:250px;dialogTop:200px;dialogLeft:150px";



                            if(deptId==""){
                                alert("请先选择部门!");
                            }else{

                                showModalDialog("${path}/dept/getDepartment.action",document ,config);

                            }
                        });
                        //增加部门信息
                        $("#addDept").click(function(){
                            var config="resizable:no;center:yes;dialogWidth:500px;dialogHeight:250px;dialogTop:200px;dialogLeft:150px";

                            /*  */

                            showModalDialog("${path}/dept/initadd.action",document ,config);
                            window.closed();
                        });
                        //更新部门信息
                        $("#update").click(function(){
                            var config="resizable:no;center:yes;dialogWidth:500px;dialogHeight:250px;dialogTop:200px;dialogLeft:150px";



                            if(deptId==""){
                                alert("请先选择部门!");
                            }else{

                                showModalDialog("${path}/dept/initupdate.action",document ,config);

                            }
                        });
                        //删除部门信息
                        $("#delete").click(function(){
                            if(deptId==""){
                                alert("请先选择部门!");
                            }else{
                                if(confirm("你确定要删除吗?")){



                                    var config="resizable:no;center:yes;dialogWidth:500px;dialogHeight:250px;dialogTop:200px;dialogLeft:150px";

                                    showModalDialog("${path}/dept/deleteDepartment.action" ,document,config);

                                    window.closed();
                                }
                            }
                        });

                    });

                    function initDeptStyle(){

                        if(deptId == ""){
                            //alert("请选择部门!!!!!!");
                        }else{
                            //alert("有拿到deptid:"+deptId);
                            setTimeout("addStyle()", 500);
                            //$("#a_"+deptId).addClass(".jstree-default .jstree-clicked");
                            //$("#a_"+deptId).addClass("myNodeStyle");
                        }
                    }

                    function addStyle(){
                        $("#a_"+deptId).addClass("jstree-clicked");
                    }

                    function submitForm(){
                        $("#myForm_dept_id").val("");
                        $("#pageNumber").val("1");
                        document.myForm.submit();
                    }


                </script>

                </head>
                <body>
                <script type="text/javascript">
                    Add();
                </script>

                <div class="main">
                    <div class="content">
                        <div class="pageHead">
                            <table>
                                <tr>
                                    <th width="8"><img src="${path}/images/c_l.gif" height="31"
                                                       width="8" /></th>
                                    <th align="left" class="title_area">当前位置：客户管理 &gt; 员工设置   </th>
                                    <th width="9"><img src="${path}/images/c_r.gif" height="31"
                                                       width="9"></th>
                                </tr>
                            </table>
                        </div>
                        <div class="pageBody">

                            <table style="text-align: center;width: 100%">
                                <tr>
                                    <td colspan="2" style="height: 20px">
                                </tr>

                                <tr>
                                    <th class="dept" style="text-align: left;">
                                        部门结构
                                        <a id="chooseRole" href="${path}/system/search.action"><img src="${path}/images/zoom.png"></a>
                                        <a id="addDept" href="${path}/system/search.action"><img src="${path}/images/add.png"></a>
                                        <a id="update" href="${path}/system/search.action"><img src="${path}/images/pencil.png"></a>
                                        <a id="delete" href="${path}/system/search.action"><img src="${path}/images/cancel.png"></a>
                                    </th>
                                    <th colspan="5">员工列表</th>
                                </tr>
                                <tr>
                                    <td rowspan="2" style="vertical-align: top;">
                                        <div class="treeGridDiv" >
                                            <div class="treeDiv" style="height:40%;width: 30%">
                                                <ul><li id="0c92e3fb-4e7e-44d9-8633-9d37206caa96" class="jstree-open"><a id="a_0c92e3fb-4e7e-44d9-8633-9d37206caa96" href="#">天智教育</a>
                                                        <ul><li id="fa400a01-944e-43ce-bd37-ea9c2f12d095"><a id="a_fa400a01-944e-43ce-bd37-ea9c2f12d095" href="#">职业发展部</a></li>
                                                            <li id="3fa77b37-8965-4fda-bfa8-b7a453a3a386"><a id="a_3fa77b37-8965-4fda-bfa8-b7a453a3a386" href="#">渠道部</a></li>
                                                            <li id="ec49cec0-1626-4244-b02d-774a4d4e54d1"><a id="a_ec49cec0-1626-4244-b02d-774a4d4e54d1" href="#">总经理室</a></li>
                                                            <li id="6e6cd6f6-a614-4795-ae76-dba276afc0ca"><a id="a_6e6cd6f6-a614-4795-ae76-dba276afc0ca" href="#">市场部</a></li>
                                                            <li id="d21346de-fa4c-4bce-999f-b96b29cec63c" class="jstree-open"><a id="a_d21346de-fa4c-4bce-999f-b96b29cec63c" href="#">财务部</a>
                                                                <ul><li id="cd898e7f-e750-4123-bb4a-b9fe07344053"><a id="a_cd898e7f-e750-4123-bb4a-b9fe07344053" href="#">学员部</a></li>
                                                                    <li id="227ae7f8-6f60-4b7b-b12f-0bfc023cd59f"><a id="a_227ae7f8-6f60-4b7b-b12f-0bfc023cd59f" href="#">员工部</a></li></ul>
                                                            </li>
                                                        </ul>
                                                    </li>
                                                </ul>
                                            </div>
                                        </div>
                                    </td>
                                    <td style="text-align: left;height: 20px">
                                        <form id="search" name="myForm" action="${path}/user/search.action" method="post">
                                            <input type="hidden" name="user.dept.id" value="" id="myForm_dept_id"/>
                                            <input type="hidden" name="pager.pageNumber" value="1" id="pageNumber"/>
                                            员工姓名<input type="text" name="user.realName" value="" id="myForm_user_realName"/>
                                            <button id="btnSearch" onclick="submitForm()">查询</button>
                                            <a id="search_null" href="${path}/user/initAdd.action" class="mybutton">新增用户</a>
                                        </form>

                                    </td>

                                </tr>
                                <tr>
                                    <td style="vertical-align: top;">
                                        <div class="gridDiv">
                                            <table class="mytable resultTable" style="width: 100%">
                                                <tr>
                                                    <th style="width: 40px">排序</th>
                                                    <th style="width: 60px">姓名</th>
                                                    <th style="width: 60px">登陆账号</th>
                                                    <th style="width: 60px">账号状态</th>
                                                    <th style="width: 60px">所属部门</th>
                                                    <th style="width: 60px">客户上限</th>
                                                    <th style="width: 60px">操作</th>
                                                </tr>

                                                <c:if test="${ !empty pager.list}">
                                                    <c:forEach items="${pager.list}" var="user" varStatus="s">
                                                        <tr>
                                                            <td>
                                                                ${s.index+1}
                                                            </td>
                                                            <td>${user.realName}</td>
                                                            <td>${user.username}</td>
                                                            <td>${user.valid}</td>
                                                            <td>${user.dept.deptName}</td></td>
                                                            <td>${user.maxCustomer}</td>
                                                            <td>
                                                                <a href="${path}/user/initUpdate.action?user.id=${user.id}">编辑</a>
                                                            </td>
                                                        </tr>
                                                    </c:forEach>
                                                </c:if>

                                            </table>
                                            <div class="pager-container">



                                                <script type="text/javascript">

                                                    function pager(num){
//        alert("num:"+num);
                                                        document.getElementById("pageNumber").value = num;
                                                        document.myForm.submit();
                                                    }

                                                </script>

                                                <ul class="pager">
                                                    <li class="pageInfo">共${pager.totalCount}条记录,<li class="pageInfo">共${pager.pageCount}页，当前为第${pager.pageNumber}页</li>
                                                    <!--首页-->

                                                    <c:if test="${pager.pageNumber==1}">
                                                        <li class="firstPage currentPage">
                                                    </c:if>
                                                    <c:if test="${pager.pageNumber!=1}">
                                                        <li class="firstPage">
                                                    </c:if>
                                                            <span><a onclick="pager(1)">首页</a></span>
                                                        </li>

                                                    <!--上一页-->


                                                    <li class="prePage">
                                                        <span>
                                                            <c:if test="${pager.pageNumber-1>=1}">
                                                                <a onclick="pager(${pager.pageNumber-1})">上一页</a>
                                                            </c:if>
                                                            <c:if test="${pager.pageNumber-1<1}">
                                                                <a onclick="pager(${pager.pageNumber})">上一页</a>
                                                            </c:if>
                                                        </span>
                                                    </li>

                                                    <!--下一页-->


                                                    <li class="nextPage">
                                                        <span>
                                                            <c:if test="${pager.pageNumber+1<=pager.pageCount}">
                                                                <a onclick="pager(${pager.pageNumber+1})">下一页</a>
                                                            </c:if>
                                                            <c:if test="${pager.pageNumber+1>pager.pageCount}">
                                                                <a onclick="pager(${pager.pageNumber})">下一页</a>
                                                            </c:if>
                                                        </span>
                                                    </li>

                                                    <!--末页-->

                                                    <c:if test="${pager.pageNumber==pager.pageCount}">
                                                        <li class="lastPage currentPage">
                                                    </c:if>
                                                    <c:if test="${pager.pageNumber!=pager.pageCount}">
                                                        <li class="lastPage">
                                                    </c:if>
                                                            <span><a onclick="pager(${pager.pageCount})">末页</a></span>
                                                        </li>

                                                </ul>
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </td>
    </tr>
</table>

<!--尾部-->
<div class="footer">


<<<<<<< HEAD
    <div class="seperator"></div>
    <p>
        <a href="http://www.sztzedu.com">公司主站</a>|
        <a href="#">隐私策略</a>|
        <a href="#">服务条款</a>&nbsp;
        苏州天智教育公司&reg;版权所有 2012-2015
    </p>

</div>
</body>
</html>
